package com.three.productList.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.three.core.entity.GoodsImage;
import com.three.core.vo.R;
import com.three.productList.service.GoodsImageService;
import com.three.productList.vo.GoodsImageVo;
import com.three.productList.vo.SearchForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ：li
 * @date ：Created in 2025/3/13 013 18:33
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("/product/image")
public class GoodsImageController {
    @Autowired
    private GoodsImageService goodsImageService;
    //分页查询
    @PostMapping("/select")
    public R<IPage<GoodsImage>> selectGoodsImage(@RequestBody SearchForm searchForm){
        return goodsImageService.selectGoodsImage(searchForm);
    }
    //删除按钮
    @GetMapping("/deleteProductImageById")
    public R<GoodsImage> deleteProductImageById(Integer id){
        return goodsImageService.deleteProductImageById(id);
    }
    //添加按钮
    @PostMapping("/insertProductImage")
    public R<GoodsImage> insertProductImage(@RequestBody GoodsImageVo goodsImageVo){
        return goodsImageService.insertProductImage(goodsImageVo);
    }
    //修改按钮
    @PostMapping("/updateProductImage")
    public R<GoodsImage> updateProductImage(@RequestBody GoodsImage goodsImage){
        return goodsImageService.updateProductImage(goodsImage);
    }



}
